package com.eu.ebpm.engine.entity.args;

import com.eu.ebpm.Constants;

public class BusinessParam extends Param {

	public static BusinessParam init(String name, Object value) {
		return new BusinessParam().add(name, value);
	}

	public static BusinessParam initBusinessKey(String businessKey) {
		return new BusinessParam().addBusinessKey(businessKey);
	}

	public BusinessParam add(String name, Object value) {
		args.put(name, value);
		return this;
	}

	public BusinessParam addBusinessKey(Object value) {
		args.put(Constants.BUSINESS_KEY, value);
		return this;
	}
	
	public BusinessParam addBusinessType(Object value) {
		args.put(Constants.BUSINESS_TYPE, value);
		return this;
	}

	public String getAndRemoveBusinessType() {
		String businessDesc = get(Constants.BUSINESS_TYPE);
		this.args.remove(Constants.BUSINESS_TYPE);
		return businessDesc;
	}
	
	public String getAndRemoveBusinessKey() {
		String businessKey = get(Constants.BUSINESS_KEY);
		this.args.remove(Constants.BUSINESS_KEY);
		return businessKey;
	}

	public BusinessParam addBusinessDesc(Object value) {
		args.put(Constants.BUSINESS_DESC, value);
		return this;
	}

	public String getAndRemoveBusinessDesc() {
		String businessDesc = get(Constants.BUSINESS_DESC);
		this.args.remove(Constants.BUSINESS_DESC);
		return businessDesc;
	}

}
